﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Forums
{
	using System.Web.Mvc;
	using System.Web.Routing;

	public class ForumsRoutes
	{
		public const string SystemForumIndex = "system.forum.index";
		public const string SystemForumDelete = "system.forum.delete";
		public const string SystemForumUpdate = "system.forum.update";
		public const string SystemForumCreate = "system.forum.create";
		public const string SystemForumAnnouncementIndex = "system.forum.announcement.index";
		public const string SystemForumAnnouncementDelete = "system.forum.announcement.delete";
		public const string SystemForumAnnouncementUpdate = "system.forum.announcement.update";
		public const string SystemForumAnnouncementCreate = "system.forum.announcement.create";
		public const string SystemForumPermissionIndex = "system.forum.permission.index";
		public const string SystemForumPermissionUpdate = "system.forum.permission.update";
		public const string SystemForumPermissionDelete = "system.forum.permission.delete";
		public const string SystemForumPermissionCreate = "system.forum.permission.create";
		public const string SystemForumTopicUpdate = "system.forum.topic.update";
		public const string SystemForumTopicDelete = "system.forum.topic.delete";
		public const string SystemForumTopicSpam = "system.forum.topic.spam";
		public const string SystemForumTopicMove = "system.forum.topic.move";
		public const string SystemForumTopicMerge = "system.forum.topic.merge";
		public const string SystemForumPostUpdate = "system.forum.post.update";
		public const string SystemForumPostDelete = "system.forum.post.delete";
		public const string SystemForumPostSpam = "system.forum.post.spam";
		public const string SystemForumPostMove = "system.forum.post.move";
		public const string SystemForumPostMerge = "system.forum.post.merge";
		public const string SystemForumPostCopy = "system.forum.post.copy";
		public const string ForumIndex = "forum.index";
		public const string ForumAnnouncementDetail = "forum.announcement.detail";
		public const string ForumPostDelete = "forum.post.delete";
		public const string ForumPostUpdate = "forum.post.update";
		public const string ForumPostCreate = "forum.post.create";
		public const string ForumTopicIndex = "forum.topic.index";
		public const string ForumTopicTagged = "forum.topic.tagged";
		public const string ForumTopicDetail = "forum.topic.detail";
		public const string ForumTopicPoll = "forum.topic.poll";
		public const string ForumTopicCreate = "forum.topic.create";

		/// <summary>
		/// Registers the specified routes.
		/// </summary>
		/// <param name="routes">The routes.</param>
		public static void Register(RouteCollection routes)
		{
			#region System Forum
			routes.Add(SystemForumDelete, new Route("system/forums/delete/{id}",
				new RouteValueDictionary(new { area = "system", controller = "systemforum", action = "delete", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumUpdate, new Route("system/forums/update/{id}",
				new RouteValueDictionary(new { area = "system", controller = "systemforum", action = "update", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumCreate, new Route("system/forums/create",
				new RouteValueDictionary(new { area = "system", controller = "systemforum", action = "create" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumIndex, new Route("system/forums/all",
				new RouteValueDictionary(new { area = "system", controller = "systemforum", action = "index" }),
				new MvcRouteHandler()));
			#endregion

			#region System Forum Announcement
			routes.Add(SystemForumAnnouncementIndex, new Route("system/forums/announcements/all",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumannouncement", action = "index", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumAnnouncementDelete, new Route("system/forums/announcements/delete/{id}",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumannouncement", action = "delete", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumAnnouncementUpdate, new Route("system/forums/announcements/update/{id}",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumannouncement", action = "update", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumAnnouncementCreate, new Route("system/forums/announcements/create/{id}",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumannouncement", action = "create", id = "" }),
				new MvcRouteHandler()));
			#endregion

			#region System Forum Permission
			routes.Add(SystemForumPermissionIndex, new Route("system/forums/permissions/all",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpermission", action = "index" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPermissionUpdate, new Route("system/forums/permissions/update/{id}",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpermission", action = "update", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPermissionDelete, new Route("system/forums/permissions/delete/{id}",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpermission", action = "delete", id = "" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPermissionCreate, new Route("system/forums/permissions/create/{id}",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpermission", action = "create", id = "" }),
				new MvcRouteHandler()));
			#endregion

			#region System Forum Topic
			routes.Add(SystemForumTopicUpdate, new Route("system/forums/topics/update",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumtopic", action = "update" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumTopicDelete, new Route("system/forums/topics/delete",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumtopic", action = "delete" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumTopicSpam, new Route("system/forums/topics/spam",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumtopic", action = "spam" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumTopicMove, new Route("system/forums/topics/move",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumtopic", action = "move" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumTopicMerge, new Route("system/forums/topics/merge",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumtopic", action = "merge" }),
				new MvcRouteHandler()));
			#endregion

			#region System Forum Post
			routes.Add(SystemForumPostUpdate, new Route("system/forums/posts/update",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpost", action = "update" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPostDelete, new Route("system/forums/posts/delete",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpost", action = "delete" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPostSpam, new Route("system/forums/posts/spam",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpost", action = "spam" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPostMove, new Route("system/forums/posts/move",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpost", action = "move" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPostMerge, new Route("system/forums/posts/merge",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpost", action = "merge" }),
				new MvcRouteHandler()));

			routes.Add(SystemForumPostCopy, new Route("system/forums/posts/copy",
				new RouteValueDictionary(new { area = "system/systemforum", controller = "systemforumpost", action = "copy" }),
				new MvcRouteHandler()));
			#endregion

			routes.Add(ForumIndex, new Route("forums/all",
				new RouteValueDictionary(new { controller = "forum", action = "index", id = "" }),
				new MvcRouteHandler()));

			routes.Add(ForumPostDelete, new Route("forums/posts/delete/{id}",
				new RouteValueDictionary(new { area = "forum", controller = "forumpost", action = "delete", id = "" }),
				new MvcRouteHandler()));

			routes.Add(ForumPostUpdate, new Route("forums/posts/update/{id}",
				new RouteValueDictionary(new { area = "forum", controller = "forumpost", action = "update", id = "" }),
				new MvcRouteHandler()));

			routes.Add(ForumTopicCreate, new Route("forums/topics/create/{id}",
				new RouteValueDictionary(new { area = "forum", controller = "forumtopic", action = "create", id = "" }),
				new MvcRouteHandler()));

			routes.Add(ForumPostCreate, new Route("forums/posts/create/{id}/{quote}",
				new RouteValueDictionary(new { area = "forum", controller = "forumpost", action = "create", id = "", quote = "false" }),
				new MvcRouteHandler()));

			routes.Add(ForumAnnouncementDetail, new Route("forums/announcements/{slug}/{id}",
				new RouteValueDictionary(new { area = "forum", controller = "forumannouncement", action = "detail", id = "", slug = "" }),
				new MvcRouteHandler()));

			routes.Add(ForumTopicIndex, new Route("forums/topics/all/{slug}/{id}/{sort}/{order}/{page}",
				new RouteValueDictionary(new { area = "forum", controller = "forumtopic", action = "index", id = "", slug = "", sort = "created", order = "desc", page = "1" }),
				new MvcRouteHandler()));

			routes.Add(ForumTopicTagged, new Route("forums/topics/tagged/{slug}/{page}",
				new RouteValueDictionary(new { area = "forum", controller = "forumtopic", action = "tagged", slug = "", page = "1" }),
				new MvcRouteHandler()));

			routes.Add(ForumTopicPoll, new Route("forums/topics/polls/{slug}/{id}",
				new RouteValueDictionary(new { area = "forum", controller = "forumtopic", action = "poll", id = "", slug = "" }),
				new MvcRouteHandler()));

			routes.Add(ForumTopicDetail, new Route("forums/topics/{slug}/{id}/{page}",
				new RouteValueDictionary(new { area = "forum", controller = "forumtopic", action = "detail", id = "", slug = "", page = "1" }),
				new MvcRouteHandler()));
		}
	}
}